/****************************************************************************
 * Copyright (C) 2009-2010 SciTouch LLC
 * 
 * This file is part of Indigo toolkit.
 * 
 * This file may be distributed and/or modified under the terms of the
 * GNU General Public License version 3 as published by the Free Software
 * Foundation and appearing in the file LICENSE.GPL included in the
 * packaging of this file.
 * 
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 ***************************************************************************/

#ifndef _DINGO_C_INTERFACE_H_
#define _DINGO_C_INTERFACE_H_

#ifdef _WIN32
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT
#endif

#ifndef __cplusplus
   #define CEXPORT DLLEXPORT
#else
   #define CEXPORT extern "C" DLLEXPORT
#endif

typedef unsigned char byte;

#ifdef _WIN32
#define qword unsigned _int64
#else
#define qword unsigned long long
#endif

#define DINGO_VERSION_MAJOR 1
#define DINGO_VERSION_MINOR 4
#define DINGO_VERSION_REVISION 4740

CEXPORT int dingoVersionCode (void);
CEXPORT const char* dingoVersionRevisionString (void);

CEXPORT qword dingoAllocSessionId ();
CEXPORT void dingoSetSessionId (qword id);
CEXPORT qword dingoGetSessionId ();
CEXPORT void dingoReleaseSessionId (qword id);
CEXPORT const char* dingoGetLastError ();
CEXPORT void dingoBeginLog (const char* path);
CEXPORT void dingoEndLog ();

CEXPORT int dingoSetLoadHighlighting (int enabled);

CEXPORT int dingoLoadMolFromFile (const char *filename);
CEXPORT int dingoLoadMolFromBuffer (const byte *buf, int buf_size);
CEXPORT int dingoLoadMolFromString (const char *str);
CEXPORT int dingoLoadReactionFromFile (const char *filename);
CEXPORT int dingoLoadReactionFromBuffer (const byte *buf, int buf_size);
CEXPORT int dingoLoadReactionFromString (const char *str);
CEXPORT int dingoMoleculeIsEmpty ();
CEXPORT int dingoReactionIsEmpty ();
CEXPORT int dingoSetOptions (const char *options);
CEXPORT int dingoSetOption (const char *name, const char *value);
CEXPORT int dingoSetOptionSize (const char *name, int w, int h);
CEXPORT int dingoSetOptionEnabled (const char *name, int enabled);
CEXPORT int dingoSetOptionFloat (const char *name, float value);
CEXPORT int dingoSetOptionColor (const char *name, float r, float g, float b);

CEXPORT int dingoSetHDCOffset (int x, int y);
CEXPORT int dingoSetOutputHDC (void* hdc);
CEXPORT int dingoSetOutputHDCPrinting (void* hdc);

////////////////////////////////////////////////////////////////
// Obsolete. Use dingoSetOptions() instead.
CEXPORT int dingoSetInputFormat (const char *format);
CEXPORT int dingoSetOutputFormat (const char *format);
CEXPORT int dingoSetImageSize (int width, int height);
CEXPORT int dingoSetBondLength (float length);
CEXPORT int dingoSetMarginFactor (float factor);
CEXPORT int dingoSetOutputFile (const char *filename);
CEXPORT int dingoSetRelativeThickness (float rt);
CEXPORT int dingoSetBackgroundColor (float r, float g, float b);
CEXPORT int dingoSetBaseColor (float r, float g, float b);
CEXPORT int dingoSetImplicitHydrogenMode (const char* mode);
CEXPORT int dingoSetColoring (int enabled);
CEXPORT int dingoSetValencesVisible (int enabled);
CEXPORT int dingoSetAtomIdsVisible (int enabled);
CEXPORT int dingoSetBondIdsVisible (int enabled);
CEXPORT int dingoSetStereoOldStyle (int enabled); 
CEXPORT int dingoSetAromatization (const char* arom);
CEXPORT int dingoSetLabelMode (const char* mode); 
CEXPORT int dingoSetHighlightThicknessEnabled (int enabled);
CEXPORT int dingoSetHighlightColorEnabled (int enabled);
CEXPORT int dingoSetHighlightColor(float r, float g, float b);
CEXPORT int dingoSetAAMColor (float r, float g, float b);
CEXPORT int dingoSetCenterDoubleBondWhenStereoAdjacent (int enabled);
CEXPORT int dingoSetComment (const char* comment);
CEXPORT int dingoSetCommentFontSize (float fontSize);
CEXPORT int dingoSetCommentPosition (const char* pos);
CEXPORT int dingoSetCommentAlignment (const char* align);
CEXPORT int dingoSetCommentColor (float r, float g, float b);
////////////////////////////////////////////////////////////////

CEXPORT int dingoRender ();
CEXPORT int dingoLayout ();
CEXPORT int dingoReset ();
CEXPORT int dingoGetResult (byte **buf, int *buf_size);

#endif // _DINGO_C_INTERFACE_H_
